﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/TwoColumn.master" AutoEventWireup="true" CodeBehind="Dashboard.aspx.cs" Inherits="Frogism.Web.Views.Money.Dashboard" %>
<%@ Register src="BudgetSummary.ascx" tagname="BudgetSummary" tagprefix="uc1" %>
<%@ Register src="NetWorthSummary.ascx" tagname="NetWorthSummary" tagprefix="uc2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="LeftContentPlaceHolder" runat="server">



<div id="box"  >
 
        <div class="box item2">
        <ul id="leftNav">
        <li><%= Html.ActionLink("Add Transaction", "New") %></li>
        <li><%= Html.ActionLink("View Recent", "Recent") %></li>
        <li><%= Html.ActionLink("View UnConfirmed", "UnConfirmed") %></li>
        <li><%= Html.ActionLink("View All", "All") %></li>
        <li><%= Html.ActionLink("Categories", "Categories")%></li>
        </ul>
 
        <div class="SectionTitle">Budget</div>
  <uc1:BudgetSummary ID="BudgetSummary1" runat="server" />
       <br />
         <div class="SectionTitle">Net Worth</div>
  <uc2:NetWorthSummary ID="NetWorthSummary1" runat="server" />
        </div>
        <div class="box item4">
         <form runat="server" id="form1">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    <Services>
        <asp:ServiceReference Path="~/MoneyService.asmx" />
    </Services>
   
    </asp:ScriptManager>

  
<div class="SectionTitle">Account Summary</div>
<asp:ListView ID="accountList" runat="server" >
    <LayoutTemplate>
	    <table class="DashboardTable" cellspacing="0" cellpadding="1">
		    <tr>
				<th>Label</th>
				<th>Purpose</th>
				<th>Balance</th>
				<th>Confirmed</th>
				<th>LastMonth</th>
				<th>Remaining</th>
				<th>Next Goal</th>
				<th>To Go</th>
			</tr>
			<asp:PlaceHolder ID="itemPlaceHolder" runat="server" />
		</table>
	</LayoutTemplate>
	<AlternatingItemTemplate>
	    <tr>
		 	<td><a href="<%# Url.Action("ViewByAccount",new { id = Eval("Id") })%>" onmouseout="return HideAccountDetails();" onmouseover="ShowAccountDetails(<%#Eval("Id")%>,'<%# Eval("Name") %>');"><%# Eval("Name") %>&nbsp;</a></td>
			<td><%# Eval("Purpose")%>&nbsp;</td>
			<td class="NumberCell"><a href="<%# Url.Action("MarketAdjust",new { id = Eval("Id") })%>?width=350&height=100"  class="thickbox"><%# Eval("Balance")%>&nbsp;</a></td>
			<td class="NumberCell"><%# Eval("ConfirmedBalance")%>&nbsp;</td>
			<td class="NumberCell"><span title="Change = <%# Eval("Change")%>"><%# Eval("LastMonth")%>&nbsp;</span></td>
			<td class="NumberCell"><span title="% Paid = <%# Eval("RemainingPercent")%>"><%# Eval("Remaining")%>&nbsp;</span></td>
			<td class="NumberCell"><%# Eval("NextGoalValue")%>&nbsp;</td>
			<td class="NumberCell"><%# Eval("ToGo")%>&nbsp;</td>
		</tr>
	</AlternatingItemTemplate>
	<ItemTemplate>
		<tr class="AltColumn">
		  	<td><a href="<%# Url.Action("ViewByAccount",new { id = Eval("Id") })%>" onmouseout="return HideAccountDetails();" onmouseover="ShowAccountDetails(<%#Eval("Id")%>,'<%# Eval("Name") %>');"><%# Eval("Name") %>&nbsp;</a></td>
		    <td><%# Eval("Purpose")%>&nbsp;</td>
			<td class="NumberCell"><a alt="Update Read for Today" class="thickbox" href="<%=Request.ApplicationPath %>/Money.ctc/MarketAdjust/<%#Eval("Id")%>?width=350&height=100"><%# Eval("Balance")%>&nbsp;</a></td>
			<td class="NumberCell"><%# Eval("ConfirmedBalance")%>&nbsp;</td>
			<td class="NumberCell"><span title="Change = <%# Eval("Change")%>"><%# Eval("LastMonth")%>&nbsp;</span></td>
			<td class="NumberCell"><span title="<%# String.Format("% Paid = {0}", Eval("RemainingPercent"))%>"><%# Eval("Remaining")%>&nbsp;</span></td>
			<td class="NumberCell"><%# Eval("NextGoalValue")%>&nbsp;</td>
			<td class="NumberCell"><%# Eval("ToGo")%>&nbsp;</td>	
		</tr>
	</ItemTemplate>
	<EmptyDataTemplate>
			Thre are no accounts to be listed.
	</EmptyDataTemplate>
</asp:ListView>
</form>
    </div>


</div>


</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="RightContentPlaceHolder" runat="server">
   
</asp:Content>
<asp:Content ID="HeadHolder1" ContentPlaceHolderID="HeadContentPlaceHolder" runat="server" >
 
    <script language="javascript" type="text/javascript" src="<%=Url.Content("~/js/overlib.js") %>" ></script>
    <script language="javascript" type="text/javascript" src="<%=Url.Content("~/js/jquery.masonry.min.js") %>" ></script>
  <script language="javascript" type="text/javascript">
  $(document).ready(function(){
  $('#box2').masonry({
          columnWidth: 500,
//  singleMode: true, 
        itemSelector: '.box' 
        });
  });
  
    var accountName;
var currentAccount;
function ShowAccountDetails(id,name){
accountName = name;
currentAccount = id;
   // overlib("Loading...", CAPTION, 'Account ' + name + ' Specifics', FGCOLOR, '#eeeeee', BGCOLOR, '#79C900', BORDER, 1, CAPTIONFONT, 'Garamond', TEXTSIZE,1);
    Frogism.Web.MoneyService.AccountDetails(id,OnSucceeded,OnFail,"string");
   // var htmlContent = "This should be the details of <b>" + id + "</b>.";
   // overlib(htmlContent, CAPTION, '?AccountName?', FGCOLOR, '#FFFFFF', BGCOLOR, '#cccccc', BORDER, 1, CAPTIONFONT, 'Garamond', TEXTFONT, 'Courier',);
}

function HideAccountDetails(){
    currentAccount = null;
    return nd();
}

     function OnFail(error)

    {
        alert("Service Error: " + error.get_message());
    }
    function OnSucceeded(result)
    {
        if(currentAccount == null)
            return;
        var htmlContent = result;
    //    alert(result);
        overlib(htmlContent, CAPTION, 'Account ' + accountName + ' Specifics', FGCOLOR, '#eeeeee', BGCOLOR, '#79C900', BORDER, 1, CAPTIONFONT, 'Garamond', TEXTSIZE,1);
    }
</script>
<style type="text/css" >

/**** Masonry CSS ****/

.wrap {
    background: #FFF;
    border: 0px solid #456;
    padding: 10px;
	margin-bottom: 20px;
	-moz-border-radius: 5px;
	-webkit-border-radius: 5px;
	border-radius: 5px;
}

.wrap:after {
    content: ".";
    display: block;
    height: 0;
    clear: both;
    visibility: hidden;
}

.box {
    margin: 3px;
    padding: 2px;
    /*background: #D8D5D2;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    border-radius: 5px;
    font-size: 11px;*/
    float: left;
}



.item1 { width: 150px; }
.item2 { width: 480px; }
.item3 { width: 480px; }
.item4 { width: 640px; }

</style>
</asp:Content>